-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make tree-sitter feature optional #332
make tree-sitter feature optional #332
Conversation
Hi @jdonszelmann! Thanks for the contribution. I agree that this shouldn't be pulled in by default. I'd suggest to make the change slightly differently though:
This way BTW, I'd also love to hear what you are doing with stack graphs! |
How about this? |
Co-authored-by: Terts Diepraam <[email protected]>
Co-authored-by: Terts Diepraam <[email protected]>
Co-authored-by: Terts Diepraam <[email protected]>
18af1e4
to
0bbb98a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case my comment was too brief, I'll also add comments on the diff for what I have in mind :)
lsp-positions/Cargo.toml
Outdated
@@ -17,7 +17,7 @@ edition = "2018" | |||
test = false | |||
|
|||
[features] | |||
default = ["tree-sitter"] | |||
default = ["dep:tree-sitter"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change default
to tree-sitter
here, and reorder to keep alphabetical.
stack-graphs/Cargo.toml
Outdated
@@ -13,6 +13,7 @@ authors = [ | |||
edition = "2018" | |||
|
|||
[features] | |||
default = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this.
stack-graphs/Cargo.toml
Outdated
@@ -32,7 +33,7 @@ enumset = "1.1" | |||
fxhash = "0.2" | |||
itertools = "0.10" | |||
libc = "0.2" | |||
lsp-positions = { version = "0.3", path = "../lsp-positions" } | |||
lsp-positions = { version = "0.3", path = "../lsp-positions", default-features=false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling the default-features
shouldn't be necessary anymore with the change above.
Co-authored-by: Terts Diepraam [email protected]
This should be all your suggestions (some were already covered in the previous commits) |
Also, where would you like to hear what we use it for? :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was one left, and a small style nit.
stack-graphs/Cargo.toml
Outdated
@@ -32,7 +32,7 @@ enumset = "1.1" | |||
fxhash = "0.2" | |||
itertools = "0.10" | |||
libc = "0.2" | |||
lsp-positions = { version = "0.3", path = "../lsp-positions" } | |||
lsp-positions = { version = "0.3", path = "../lsp-positions"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit Keep the space at the end as well.
lsp-positions/Cargo.toml
Outdated
default = ["dep:tree-sitter"] | ||
bincode = ["dep:bincode"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default = ["dep:tree-sitter"] | |
bincode = ["dep:bincode"] | |
bincode = ["dep:bincode"] | |
tree-sitter = ["dep:tree-sitter"] |
ah I see, good to see that you're thorough on this haha, hope this is finally it. |
You can start a show and tell discussion on this repo, or send me an email, whatever you prefer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
We were using stack-graphs for a project we were working on. One of the slowest dependencies to compile was tree-sitter, and we weren't even using that part of stack-graphs! So we made the dependency optional :). The feature flag is enabled by default, so nothing changes about the public api and nobody else's code will break but for those who don't need it's a nice speedup.